//
//  MZRequest.swift
//  MZTool
//
//  Created by gby on 2023/2/6.
//

import Alamofire


public protocol MZZRequest {
    
//    func asURLRequest() throws -> URLRequest
    
}


public protocol MZApiRequest: MZZRequest {
    
    var baseURL: URL {get}
    
    var path: String {get}
    
    var method: MZMethod {get}
    
    var headers: [String: String]? {get}
    
    var task: MZTask {get}
    
    var validationType: MZValidationType {get}
}


public extension MZApiRequest {
    var validationType: MZValidationType { return .none}
}






//    static func requestAsync(_ api: MGSApi) async -> Any? {
//        do {
//            return try await withCheckedThrowingContinuation({ continuation in
//                self.shareProvidor.request(api) { result in
//                    switch result{
//                    case .success(let resp):
//                        continuation.resume(returning: resp.data)
//                    case .failure(let error):
//                        continuation.resume(throwing: error)
//                    }
//                }
//            })
//        }catch {
//            return NSError.init(domain: "native", code: -1, userInfo: [NSLocalizedDescriptionKey: "数据获取失败"])
//        }
//    }
